<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
	<c:set var="emp" value="${sessionScope.user}"/>
	
   	<!--左边侧栏容器-->
       <aside class="left-side sidebar-offcanvas">
           <section class="sidebar">
               <!-- 侧边栏用户信息 -->
               <div class="user-panel">
                   <!--图片信息-->
                   <div class="pull-left image">
                       <img src="${initParam.root}/static/img/avatar3.png" class="img-circle" alt="User Image" />
                   </div>
                   <!--显示用户名-->
                   <div class="pull-left info">
                       <p>你好，${sessionScope.user.name }</p>
                       <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                   </div>
               </div>
               <!--侧边栏菜单-->
               <ul class="sidebar-menu">
                   <li class="active">
                       <a href="${initParam.root}/index">
                           <i class="fa fa-dashboard"></i> <span>主页</span>
                       </a>
                   </li>
                   
                   <c:forEach var="item" items="${emp.roles }">
                   		<c:forEach var="fu" items="${item.functions['menuItem']}">
                   			<c:if test="${not empty fu.children}">
                   				<li class="treeview">
                   			</c:if>
                   			<c:if test="${empty fu.children}">
                   				<li>
                   			</c:if>
	                   			<c:if test="${empty fu.parentId}">
	                   				<c:if test="${fu.id==40}">
		                   				<a href="${initParam.root}/${fu.menuEntry}?parentId=${fu.id}&categoryId=1">
			                   				<i class="${fu.menuLog }"></i>
		                           			<span>${fu.name }</span>
		                           			<c:if test="${not empty fu.children}">
		                           				<i class="fa fa-angle-left pull-right"></i>
		                           			</c:if>
	                           			</a>
	                   				</c:if>
	                   				<c:if test="${fu.id!=40}">
		                   				<a href="${initParam.root}/${fu.menuEntry}?parentId=${fu.id}">
			                   				<i class="${fu.menuLog }"></i>
		                           			<span>${fu.name }</span>
		                           			<c:if test="${not empty fu.children}">
		                           				<i class="fa fa-angle-left pull-right"></i>
		                           			</c:if>
	                           			</a>
	                   				</c:if>
	                   				
	                   			</c:if>
	                   			<c:if test="${not empty fu.children}">
	                   				<ul class="treeview-menu">
	                   			</c:if>
	                   			<c:if test="${empty fu.children}">
	                   				<ul>
	                   			</c:if>
	                               <c:if test="${not empty fu.children}">
	                               		<c:forEach var="child" items="${fu.children}">
	                               			<li><a href="${initParam.root}/${child.menuEntry}?parentId=${child.id}"><i class="fa fa-angle-double-right"></i> ${child.name}</a></li>
	                               		</c:forEach>
	                               </c:if>
	                           </ul>
                   			</li>
                   		</c:forEach>
                   </c:forEach>
                   
                   <!-- <li>
                       <a href="#">
                           <i class="fa fa-th"></i> <span>部件</span>
                           new 小图标
                           <small class="badge pull-right bg-green">new</small>
                       </a>
                   </li>
                   图表 树节点
                   <li class="treeview">
                       <a href="#">
                           <i class="fa fa-bar-chart-o"></i>
                           <span>图表</span>
                           <i class="fa fa-angle-left pull-right"></i>
                           <ul class="treeview-menu">
                               <li><a href="#"><i class="fa fa-angle-double-right"></i> 销售业绩分析</a></li>
                               <li><a href="#"><i class="fa fa-angle-double-right"></i> 市场占有率分析</a></li>
                               <li><a href="#"><i class="fa fa-angle-double-right"></i>客户分析</a></li>
                           </ul>
                       </a>
                   </li>
                   日历
                   <li>
                       <a href="#">
                           <i class="fa fa-calendar"></i> <span>日历</span>
                           <small class="badge pull-right bg-red">3</small>
                       </a>
                   </li>
                   邮箱
                   <li>
                       <a href="#">
                           <i class="fa fa-envelope"></i><span>邮箱</span>
                           <small class="badge pull-right bg-yellow">12</small>
                       </a>
                   </li>
                   <li class="treeview">
                       <a href="#">
                           <i class="fa fa-folder"></i> <span>文件</span>
                           <i class="fa fa-angle-left pull-right"></i>
                       </a>
                       <ul class="treeview-menu">
                           <li><a href="#"><i class="fa fa-angle-double-right"></i> 登录</a></li>
                           <li><a href="#"><i class="fa fa-angle-double-right"></i> 注册</a></li>
                           <li><a href="#"><i class="fa fa-angle-double-right"></i> 锁屏页面</a></li>
                           <li><a href="#"><i class="fa fa-angle-double-right"></i> 404 错误页面</a></li>
                           <li><a href="#"><i class="fa fa-angle-double-right"></i> 500 错误页面</a></li>
                       </ul>
                   </li> -->
               </ul>
           </section>
       </aside>
